<?php
namespace core\tv\model;

use core\Model;
use core\tv\model\StoreModel;

class PlayLogModel extends Model
{

    /**
     * 去前缀表名
     *
     * @var unknown
     */
    protected $name = 'tv_play_log';

    /**
     * 自动写入时间戳
     *
     * @var unknown
     */
    protected $autoWriteTimestamp = true;

    /**
     * 别名查询
     *
     * @return \think\db\Query
     */
    public function aliasQuery($alias)
    {
        return $this->alias($alias)
        ->field($alias.'.*,s.store_name')
        ->join(StoreModel::getInstance()->getTableShortName() . ' s', 's.id = '.$alias.'.store_id');
    }


}